home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ccdl151e.zip / LIBP.H < prev    next >
Text File  |  1997-06-09  |  2KB  |  73 lines

  1. /* The prototypes in this file which start with _ll are OS dependent
  2.  * and some of the C functions will require them to be implemented
  3.  * notably:
  4.  *   memory allocation
  5.  *   file handling
  6.  *   time & date
  7.  *   system-level functions
  8.  *
  9.  * C functions which don't depend on the above mechanisms are self-contained
  10.  * and should work generically
  11.  */
  12.  
  13. /* Initialize the file stuff */
  14. void _ll_init(void);
  15.  
  16. /* File open close */
  17. int _ll_open(const char *__name, int flags);
  18. int _ll_creat(const char *__name, int flags);
  19. int _ll_close(int __fd);
  20.  
  21. /* Convert C-style open flags to os-style open flags */
  22. int _ll_flags(int __oldflags);
  23.  
  24. /* File read/write */
  25. int _ll_write(int __fd,void *__buf,size_t __size);
  26. int _ll_read(int __fd,void *__buf,size_t __len);
  27.  
  28. /* File positioning */
  29. size_t _ll_getpos(int __fd);
  30. int _ll_seek(int __fd, size_t __pos, int __origin);
  31.  
  32. /* File utilities */
  33. int _ll_rename(const char *__old, const char *__new);
  34. int _ll_remove(const char *__name);
  35.  
  36. /* malloc stuff */
  37. void *_ll_malloc(size_t __size);
  38. void _ll_free(void *__blk);
  39. void _ll_transfer(void);
  40.  
  41. /* System stuff */
  42. int _ll_getenv(char *buf, int id);
  43. int _ll_system(const char *string);
  44.  
  45. /* Time & date stuff */
  46. void _ll_gettime(time_t *__time);
  47. long _ll_ticks(void);
  48.  
  49. /* Spawn function */
  50. int _ll_spawn(char *name, char *parms, char **env);
  51.  
  52. /* Internal functions, already implemented */
  53. int _baseputc(int __c, FILE *__stream);
  54. int _basegetc(FILE *__stream);
  55. FILE *_basefopen(const char *name, const char *mode,FILE *stream);
  56. int _basefclose(FILE *stream,int release);
  57. int _scanf(char *buffer, const char *format,void *arglist);
  58. int _writebuf(FILE *__stream);
  59.  
  60. /* The following constants and structures govern the memory allocation
  61.  * mechanism
  62.  */
  63. #define ALLOCSIZE 100*1024
  64.  
  65. typedef struct _freelist {
  66.     size_t size;
  67.     struct _freelist *next;
  68. } FREELIST;
  69.  
  70. typedef struct _blkhead {
  71.     struct _blkhead *next;
  72.     FREELIST *list;
  73. } BLKHEAD;